package com.wwinsoft.framework.web;

import com.opensymphony.xwork2.ActionSupport;
import com.wwinsoft.modules.utils.web.struts2.Struts2Utils;

/**
 * @author: Tim.Chen
 * @since: 1.0
 */
public class BaseActionSupport extends ActionSupport {

    public static final int MSG_TYPE_INFO = 1;
    public static final int MSG_TYPE_ERROR = -1;


    protected void addInfoMessage(String message) throws Exception {
        Struts2Utils.getSession().setAttribute("MSG_TYPE", MSG_TYPE_INFO);
        this.addActionMessage(message);
    }

    protected void addErrorMessage(String message) throws Exception {
        Struts2Utils.getSession().setAttribute("MSG_TYPE", MSG_TYPE_ERROR);
        this.addActionMessage(message);
    }

}
